Infinity-Start-Event names a function, with lambda list (D USER RECIPIENT/S):
Attempt to begin a Quaestor Event. Might return an error.
Lisp START-EVENT = JSON startEvent
The bulk of the actual work is in TOOTSVILLE QUAESTOR-START-EVENT, q.v.
Events, in the context of this function, are transactions between a player and the world. These transactions might yield items or currency (peanuts, or fairy dust), so they have to be proxied through the central servers, because we can't ultimately trust the users not to just tap Control+Shift+K and try something like Tootsville.Game.addPeanuts (1000000). (Note, that will --- obviously --- not work, because this function exists.)
So, there are a few basic types of events, in general:
Each of these works a little differently.
The basic data element is a moniker, which is typically the representation of a particular item in the world which is the focus of the event. In the current usage (Tootsville V/Romance 2), this will be an UUID.
{ c: "startEvent", d: { moniker: "moniker" } }
There are several possible responses.
{ from: "startEvent", status: false, alreadyDone: true, err: "event.alreadyDone", error: "User-visible error message" moniker: "moniker" }
Some events cannot be started more than once by the same character, or more than once within a certain period of time, or more than once by the same character within a certain period of time. This is a simple rejection; there is not inherently any explanation to the client of the circumstances --- in particular, the client is not informed when (or by whom) the event can be fired again.
{ from: "startEvent", status: true, eventID: "ID" }
This is the short form. It means that the event can be started, and the caller had better know what to do about it; typically, that will only be to turn around and immediately call TOOTSVILLE INFINITY-END-EVENT with the provided event ID.
{ from: "startEvent", status: true, eventID: "ID", filename: "blah.swf", asVersion: ( 2 | 3 ) }
This form is archaic and won't be returned right now, but is included for comparison --- and to make the modern long form make sense by comparison.
{ from: "startEvent", status: true, eventID: "ID", filename: "blah.js", function: "foo", asVersion: "html5" }
This is the modern long form. The client is expected to:
In other words,
Tootsville.Event [ datagram.function ] ( datagram.eventID );
The code in blah.js is required to use the opportunistic object-as-namespace initialization of the form:
if (!('Tootville' in window)) { Tootsville = { Event: { Foo: {} } }; }if (!('Event' in Tootsville)) { Tootsville.Event = { Foo: {} } }; }
if (!('Foo' in Tootsville.Event)) { Tootsville.Event.Foo = {}; }
Tootsville.Event.foo = function (eventID) { ... };
Tootsville.Event.Foo.otherMethod = function ( ... ) { ... };
See the front-end documentation for more details on the coding style used.
{ from: "startEvent", status: false, err: "error code", error: "User-visible error message" }
The error code can be one of:
This event is now open, and will remain open until it has been completed or canceled using TOOTSVILLE INFINITY-END-EVENT, q.v.
WRITEME
WRITEME
WRITEME
WRITEME
WRITEME
Defined in file src/infinity/legacy-commands.lisp.